﻿namespace Gengens.Disk.WebApi.dto.output
{
    /// <summary>
    /// 通用返回格式
    /// </summary>
    public class ApiRet
    {
        public int Code { get; set; }
        public string? Msg { get; set; }
        public object? Data { get; set; }
        public bool Result { get; set; }

        public static ApiRet Ok(string msg = "", object? data = default,int code = 200)
            => new ApiRet { Code = code, Msg = msg, Data = data, Result = true };

        public static ApiRet Fail(string msg = "", object? data = default,int code = 400)
            => new ApiRet { Code = code, Msg = msg, Data = data, Result = false };
    }
}
